import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class SavingsAccountTest {
	SavingsAccount savings;
	@Before
	public void setUp() throws Exception {
	}
	
	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void testSavingsAccount() {
		savings = new SavingsAccount("name", "street", "12587", "town", "country", 357950);
		assertTrue(savings.getAccountNumber() == 357950);
	}
	
	@Test
	public void testGetAccountNumber() {
		savings = new SavingsAccount("name", "street", "12587", "town", "country", 357950);
		assertTrue(savings.getAccountNumber() == 357950);
	}
	
	@Test
	public void testCalculateInterest() {
		savings = new SavingsAccount("name", "street", "12587", "town", "country", 357950);
		savings.deposit(50000);
		assertTrue(savings.fBalance == 50000);
		savings.calculateInterest();
		assertTrue(savings.fBalance == 50625);
	}
	
	@Test
	public void testWithdrawal() {
		savings = new SavingsAccount("name", "street", "12587", "town", "country", 357950);
		savings.deposit(50000);
		assertTrue(savings.fBalance == 50000);
		
		assertTrue(savings.withdrawal(50000));
		
		assertFalse(savings.withdrawal(50000));

	}
	
	@Test
	public void testDeposit() {
		savings = new SavingsAccount("name", "street", "12587", "town", "country", 357950);
		savings.deposit(50000);
		assertTrue(savings.fBalance == 50000);
	}
	
}
